The present invention relates to monitoring program execution and the effects of program execution in a visual programming environment.
Visual programming techniques and tools allow computer programs to be developed by manipulation of visual images representing objects, providing an alternative to conventional alphanumeric-character-based programming languages. Such techniques and tools make the task of computer program development easier for programmers than was possible with earlier non-visual programming languages, and make programming accessible to non-expert programmers. Visual programming has enabled more rapid prototyping and application program development, and has generally enabled users to focus on what functions they want their program to perform by greatly reducing the requirement to learn about programming languages and the internal workings of a computer.
Nevertheless, it remains the case that the available visual programming tools and languages, such as VisualBasic from Microsoft Corporation, are mainly used for building a user interface (selecting and positioning user interface components such as buttons, scrollbars, etc, and scripting their behaviour). The user is often required to rely on conventional programming techniques for implementing the main business logic underneath the user interface.
As with other computer programs, programs developed using visual programming techniques require debugging, but in the past many visual programming tools have not enabled visual debugging. That is, the user has been provided with source level debug information which has required a greater level of understanding of languages and systems than the original visual programming task. More recently, it has been recognised that visual programmers should be provided with visual reporting of any problems which require debugging, thereby matching the problem reporting style to the requirements of a typical visual programmer rather than relying on non-intuitive source code level debug information.
PROGRAPH 2, described in Cox et al, xe2x80x9cUsing a Pictorial Representation to Combine Dataflow and Object-Orientation in a Language Independent programming Mechanismxe2x80x9d, Proceedings International Computer Science Conference, pp. 695-704, 1988, is one example of a visual programming environment which has integrated editing and debugging, and in which operations are represented pictorially as nodes of an hierarchical dataflow. Sets of windows can be opened to explore different levels of detail within a program and errors are responded to by opening a window containing the operation in question, flashing the relevant icon and generating an explanatory message.
To enable debugging of an hierarchical program, PROGRAPH 2 and other known visual programming tools rely on access to the program""s execution stack to monitor execution of the program and hence to indicate the hierarchical structure and locations within it. A program""s execution stack is the data area or buffer of the data processing apparatus on which the program is executing which is used for storing context information of the sequence of invocations for operations that are performed during execution of the program. Storing such context information during program execution is essential for successful execution of an hierarchical (or nested) programxe2x80x94to enable a program which jumps to a subroutine to return to the correct point in the program after executing the subroutine. The reliance of known debuggers on the execution stack is because an hierarchical program is typically xe2x80x9cflattenedxe2x80x9d into a linear flow for execution, such that the context within the hierarchical structure of a particular point in a program is not apparent from the executing program itself (subroutines appear as macros within a linear flow). An interpreter within PROGRAPH 2 shows the state of the execution stack in a special window and can illustrate the executing operations via a set of windows showing different levels of the hierarchy. This is fine for typical visual programmers, because their programs are limited to a single system and the program execution stack is available on the same system as the development and debugging tools. However, such a debugging solution could not be used if the execution stack is inaccessible from the debugger.
Another solution which allows debugging of dataflow diagrams in a unified visual environment without repeatedly switching between build and debug modes of operation is the PANTA development framework from Metrowerks AG (formerly HIWARE AG). The user merely switches between edit and debug windows.
U.S. Pat. No. 6,055,369 discloses a visual programming apparatus for creating a program with a visual user interface made up of multiple screens, including a unit for creating a screen flow comprising a flow of processes which includes a compressed representation of each of the multiple screens. Information can be extracted from the screen flow and used to generate source code. This assists the user in understanding the association between screens and hence designing, creating and testing a visual program.
U.S. Pat. No. 5,850,548 discloses a visual programming environment based on an hierarchical data flow model. Functional code components can be constructed either using conventional programming techniques or using a visual programming language, and these components are then connected together in an hierarchical data flow model for sending xe2x80x9cmessagesxe2x80x9d to and receiving xe2x80x9cmessagesxe2x80x9d from each other. The on-screen representation of the data flow aids debugging.
The present invention provides improved visual execution monitoring capability for computer programs.
The invention according to a first aspect provides a visual execution monitoring tool for monitoring a message processing program or system, wherein the tool enables the contents of a message to be viewed by a user while the message processing program is being executed, enabling the user to monitor the effects of execution.
The invention according to a second aspect enables automated instrumentation of computer programs, inserting execution progress report generator components which send their reports to an execution monitoring controller when certain stages of execution are reached, such that the execution monitoring controller can use the received reports to track execution progress.
According to the first aspect of the present invention, there is provided a visual execution monitoring tool for monitoring execution of a message processing program, comprising: one or more components for generating program execution progress reports upon reaching predefined stages of program execution, the execution progress reports including a representation of the current contents of a message being processed by the message processing program, and for sending the execution progress reports to an execution monitoring controller; an execution monitoring controller which is responsive to receipt of said execution progress reports for generating, during execution of said message processing program, a visual representation of the message contents.
The message contents included in the progress reports and represented visually preferably include message data and information relating to the message structure (e.g. Header fields). This may be an XML representation of the message.
The execution monitoring tool preferably includes means for inputting a test message for testing execution of the message processing program. This may comprise a message generator which is triggered to create and input a message by user definition of message data or message headers, user selection of a message type, or reading a message from an external file. The execution monitoring tool preferably also enables a programmer to change the message content when execution is stopped at a breakpoint in the program, and thus affect further execution.
The execution progress reports preferably include current execution status information from which the execution monitoring controller can generate a visual indication of execution status, such as the occurrence of exceptions. The execution progress reports preferably also include information relating to the position within the message processing program""s structure corresponding to the current stage of program execution. The execution monitoring controller preferably maintains information representing the structure of the message processing program and maps received progress reports to this structure. The execution monitoring controller then generates a visual representation of the message processing program""s structure and a visual representation of the position within the program structure corresponding to the stage of program execution indicated by the received progress report data.
The execution monitoring controller preferably maintains an updated record of certain parts of the program""s execution stack, updated from received execution progress reports. This preferably provides, in a storage area local to a debugger, the context of operation execution required for debugging the program. The sending of reports to the execution monitoring controller may be implemented by, for example, use of TCP/IP socket connections or storing reports on a storage medium which is accessible to both the execution progress report generator components and the execution monitoring controller, or an alternative.
According to the invention, the structure of an hierarchical visual message processing program can be displayed, together with the contents of a propagating message, during test execution. This facilitates debugging. This is particularly useful for monitoring execution of an hierarchical program which is executing on a separate system from the execution monitoring controller, since the monitoring controller will not then have access to the hierarchical program""s execution stack and it is undesirable to have to rely on accessing a remote system""s log records to track execution progress. The invention will also prove useful for monitoring execution of a distributed hierarchical program in which processing components of the program are executable remotely from each other, since no single system""s program execution stack would then provide the full context within the program hierarchy.
According to a preferred embodiment of the invention, the visual representation of the hierarchical visual program represents processing components of the program as interconnected nodes of an hierarchical program flow. The components for generating progress reports are preferably also implemented as separate nodes of the program flow. This consistency between progress report generator components and processing components allows a visual programmer to use consistent visual programming techniques and concepts (manipulation of visual representations of separate components) to work with both types of components. Furthermore, if the execution system is separate from but connected to the system used for programming, then no change will be required to the program""s execution system to handle the addition of report generator nodes and the report generator nodes need not be exposed to a normal user when the program is run.
In a preferred embodiment of the invention, the monitoring tool automatically instruments the program flow with progress report generator nodes, in response to analysing the program to identify certain program execution stages. This automated insertion of report generator nodes reduces the work involved in enabling execution monitoring.
The visual programmer is preferably provided with the capability to set breakpoints within the program at the positions of selected report generator nodesxe2x80x94for example at input or output terminals of processing nodes, on connections between nodes, or other significant points in the program flow. Setting of breakpoints is well known within visual programming.
The progress report generator nodes preferably include debug nodes which generate execution progress data for debugging, and the execution progress monitoring controller comprises a debug controller adapted to determine the position within an hierarchical program structure corresponding to the current state of program execution. The debug controller visually displays message contents and other information which is useful for debugging, such as an indication of the determined position.
A tool according to a preferred embodiment of the present invention is a visual programming and execution monitoring tool for developing message processing and forwarding programs, in which the processing components are represented as nodes of a visual message flow. The message flow can be debugged by executing it on a test and debug system which is connected for communication with a development system. Run-time execution can be simulated by inputting test messages to the message flow, sending execution progress reports to an execution monitoring controller, and using the controller to monitor processing of these messages and display the results to the programmer. The processing components of the test and debug execution system may be distributed across a plurality of interconnected data processing systems. In an environment in which program components may be executing on one or more systems remote from a debugger, prior art debugging solutions which rely on access to a single system""s execution stack cannot be used and the alternative of a debugger which relies on accessing the log records of a remote different system would not achieve desirable performance.
According to the preferred embodiment, program development capability including debug editing capability is integrated with the execution monitoring tool, such that development and debugging can be performed without switching modes between execution monitoring and editing and without switching from a development system to an unconnected, dedicated debugging system.
A programmer wishing to debug a visual program which is represented by a message flow provides a set of input messages (for example, the programmer either defines messages, selects predefined messages or runs communicating partner test applications to generate messages), uses the execution monitoring tool to monitor the actions performed on the message during execution, and responds to any visual indications of the occurrence of exceptions by editing the program using visual programming techniques. The structure and contents of the message can be tracked at all points in the execution of the message flow and the visual program can be developed, monitored and edited within the integrated development and debugging environment until it has been verified as working properly.
Furthermore, according to the preferred embodiment, the user""s view of the visual message flow representation of the developed program is consistent with the user""s understanding of messages flowing between nodes of a message processing and forwarding network, and this minimizes the requirement for a visual programmer who is familiar with messaging to learn new concepts before starting programming of message flows.
Such a visual programming and execution monitoring tool can be integrated within a message broker within a messaging network, or provided as a tool for use with such a broker. This is particularly advantageous since message brokers can provide a very valuable intermediary message processing and forwarding service for application programs connected via a messaging network, particularly in complex networks, and yet message brokers are required to perform different sets of operations for different enterprises and users and different enterprises will have very different combinations of new and legacy systems which are required to interoperate via the message broker. It is therefore particularly beneficial to provide visual programming and debugging capability to enable rapid customisation of the broker and integration with other systems. A message broker framework supporting modular plug and play components can benefit greatly from the present invention. Furthermore, enterprises who have a message broker in productive use for routing and transforming messages will typically prefer a runtime simulation or a test and debugging execution system which is integrated within the development environment, rather than extending their run-time production system. This is preferred both to optimize the performance of their developers and to protect their business-critical production system from programming errors.
In a further aspect, the invention provides a method for monitoring execution progress of a message processing program, including the steps of: identifying a set of locations within the message processing program corresponding to a predefined set of execution progress points, and inserting at each of said locations a component for generating program execution progress reports when the predefined execution progress points are reached during execution of the message processing program; responsive to input to the message processing program of at least one message, initiating execution of the message processing program to process said at least one message and to generate program execution progress reports including a representation of the current message contents, and to send the reports to an execution monitoring controller; responsive to receipt of said progress reports by said execution monitoring controller, generating a visual representation of the current message contents.
In a further aspect, the invention provides a computer program (preferably implemented as a computer program product comprising program code recorded on a computer readable recording medium) for controlling a data processing apparatus on which it runs to perform a method as above.
A computer program product according to a further aspect of the invention, which comprises program code recorded on a computer-readable recording medium, implements a visual execution monitoring tool for monitoring execution of a message processing program in which the program code of the tool comprises: one or more components for generating program execution progress reports upon reaching predefined stages of program execution, the execution progress reports including a representation of the current contents of a message being processed by the message processing program, and for sending the execution progress reports to an execution monitoring controller; an execution monitoring controller which is responsive to receipt of said execution progress reports for generating, during execution of said message processing program, a visual representation of the message contents.
In a further aspect of the invention, there is provided a visual execution monitoring tool for monitoring execution of a computer program, comprising: means for identifying locations within a computer program corresponding to a predefined set of execution progress points, and for inserting at each of said locations a component for generating program execution progress reports when the predefined execution progress points are reached during execution of said program; means responsive to said components generating said execution progress reports for sending the progress reports to an execution monitoring controller; an execution monitoring controller for receiving said execution progress reports and for generating, during execution of said computer program, a visual representation of the received execution progress report data.